package Summative;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class FileExtended extends FileFilter
{
	public boolean accept(File file)
	{
		String fileName = file.getName();
		
		if(file.isDirectory())
		{
			return true;
		}
		if(fileName.length() !=0)
		{
			if(fileName.substring(fileName.lastIndexOf('.'), fileName.length()).equals(".txt"))
			{
				return true;
			}
		}
		return false;
	}
	
	public String getDescription()
	{
		return (".txt");
	}
}
